package createThread;

/**
 * 第二种创建线程的方式
 * 采用实现runnable接口
 */
public class CreateThreadByInterface {
    public static void main(String[] args) {
        Task task = new Task();
        Thread thread = new Thread(task);
        thread.start();

    }
}


class Task implements Runnable{

    public void run() {
        System.out.println("thread is run ...");
    }
}
